<!DOCTYPE html>
<!--
Auteur: Claudia Plas, S1049080
-->
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Verenigingspagina</title>
    </head>
    <body>
        <?php
            $connect = mysql_connect("school.home-server.nl","root","6DMcURL");
            if (!$connect)
                {
            die('Kan geen verbinding maken: ' . mysql_error());
                }
            mysql_select_db("zoen",$connect);
                $id=$_GET["id"];
                $row=mysql_query("SELECT * FROM vereniging WHERE verenigingsid='".$id."'",$connect);
                $fetch=mysql_fetch_assoc($row);
                
                $members=mysql_query("SELECT * FROM lidmaatschap AS l JOIN student AS s 
                                      ON s.studentid=l.studentid WHERE l.verenigingsid='".$id."'",$connect);
                $evenementen=mysql_query("SELECT * FROM evenement WHERE organiserende_verenigingsid='".$id."'",$connect);
        ?>
            <a href="Wijzig_vereniging.php?id=<?php echo $id?>">Wijzigen</a>
                <table>
                    <tr>
                        <td><b>Naam</b></td> 
                        <td><?php echo $fetch["naam"]?></td>
                    </tr>
                    <tr>
                        <td><b>Adres</b></td>
                        <td><?php echo $fetch["adres"] ?></td>
                    </tr>
                    <tr>
                        <td><b>Postcode</b></td>
                        <td><?php echo $fetch["postcode"] ?></td>
                    </tr>
                    <tr>
                        <td><b>Plaats</b></td> 
                        <td><?php echo $fetch["plaats"] ?></td>
                    </tr>
                    <tr>
                        <td><b>Aantal eigen leden</b></td> 
                        <td><?php echo $fetch["aantal_eigen_leden"] ?></td>
                    </tr>
                    <tr>
                        <td><b>KvK</b></td> 
                        <td><?php echo $fetch["kvk"] ?></td>
                    </tr>
                    <tr>
                        <td><b>Contactpersoon</b></td> 
                        <td><?php echo $fetch["contactpersoon"] ?></td>
                    </tr>
                    <tr>
                        <td><b>Telefoonnummer</b></td> 
                        <td><?php echo $fetch["telefoonnummer"] ?></td>
                    </tr>
                    <tr>
                        <td><b>Emailadres</b></td> 
                        <td><?php echo $fetch["emailadres"] ?></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><input type="submit" name="submit" value="Aanmelden"/></td>
                    </tr>
                </table>
            <p/>
            
            <table>
                <tr>
                    <td>Members</td>
                </tr>
                <tr>
                    <?php for($i = 0;$i< mysql_num_rows($members);$i++)
                    {$members2 = mysql_fetch_assoc($members); 
                    echo '<td><a href="members.php?id='.$members2["studentid"].'">'
                          .$members2["voornaam"],'&nbsp;'.$members2["achternaam"].'</a></td>
                    </tr>';
                    }
                    ?>
            </table>
            
            <p/>
            <table>
                <tr>
                    <td colspan="2">Evenementen</td>
                </tr>
                <tr>
                    <?php for($i = 0;$i< mysql_num_rows($evenementen);$i++)
                    {$evenementen2 = mysql_fetch_assoc($evenementen); 
                    echo '<td><a href="eventinfo.php?id='.$evenementen2["evenementid"].'">'.$evenementen2["naam"].'</a></td>
                          <td>'.$evenementen2["begindatum"].'</td>
                    </tr>';
                    }
                    ?>
            </table>
            <p/>
            
            <a href="Verenigingslijst.php">Vorige pagina</a>
    </body>
</html>
